define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {

    var Controller = {
        index: function () {

            $(".btn-primary").click(function(){
                $.ajax({
                    type: 'POST',
                    url: "kupay/compay/infosave",
                    data: $('form').serialize(),
                    success: function (info) {
                        if (info.code == 1) {
                            layer.msg(info.msg)
                            setTimeout(function () {
                                window.location.reload()
                            }, 2000);

                        } else {
                            layer.msg(info.msg)
                        }

                    },
                });
            })
            Controller.api.bindevent();
        },
        api: {
            bindevent: function () {
                Form.api.bindevent($("form[role=form]"));
            }
        }
    };
    return Controller;
});
